#include "header.h"

struct s_bmp_img_head {
  unsigned int          header_size;
  unsigned int          width;
  unsigned int          height;
  short int             planes;
  short int             bit;
  unsigned int          comp_method;
  unsigned int          image_size;
  int                   hres;
  int                   vres;
  unsigned int          color_number;
  unsigned int          important_color;
};
 
struct s_bmp_header {
  short                 padding;
  char                  magic[2];
  unsigned int          file_size;
  unsigned int          reserved;
  unsigned int          offset;
  struct s_bmp_img_head dib;
  unsigned char         data[4];
};
 
typedef
struct s_bmp_header    *bmp;

bmp load(char* file)
{
  void* truc;
  int fd = open(file, O_RDONLY);
  struct stat buff;
  fstat(fd, &buff);
  truc = mmap(NULL, buff.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
  close(fd);
  return truc;
}

int main(int argc, char** argv)
{
  if (argc < 2)
    {
      return(1);
    }
  for (i=1; i < argc; ++i)
    {
      load(argv[i]);
    }
  return 0;
}
